package GestioneComponente;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.Vector;

import GestioneDB.ConnessioneDB;

public class Dissipatore extends Componente {
 Vector<String> socket;
 
	public Dissipatore() {
	idcategoria="ds";
	socket=new Vector<String>();
	
}
	
	public void socketCompatibili() throws ClassNotFoundException, SQLException{
		Componente c=new Componente();
		ConnessioneDB database=ConnessioneDB.getInstance();  //creo l'oggetto database per le query
		database.StartConnection();  	
		//inizio la connessione al db
		ResultSet r=database.ResultQuery("SELECT idsocket,marca FROM compatibile as comp WHERE comp.idprodotto LIKE '"+idprodotto+"'");   
		while(r.next()){
			socket.add(r.getString("idsocket"));
			socket.add(r.getString("marca"));
		}
		database.Close();
		c.setDati(idprodotto);
	}
}
